
#include "../include/sdf.glsl"

uniform sampler2D tMask;
uniform float uPercent;
uniform float uBox;

varying vec2 vUv;
varying float vPosX;
varying float vOffsetX;
varying vec3 vPositionWS;

void main() {
    float mask = texture(tMask, vUv).r;

    if(mask > vOffsetX ||
        mask < vOffsetX - 0.1 ||
        vPosX > vPositionWS.x + 0.5) {
        discard;
    }

    gl_FragColor = vec4(vec3(0.5, 1.2, 0.8), 1.);

    #include <tonemapping_fragment>
    #include <colorspace_fragment>
}